package Builder;

public class Car {
    private String carPaint;
    private boolean hasHood;
    private boolean hasLatteArt;
    private boolean hasCarbonFiberRoof;
    private boolean hasRearWing;
    private boolean hasCarbonFiberMirror;

    // 构造函数
    public Car() {}

    // Getter 和 Setter 方法
    public String getCarPaint() { return carPaint; }
    public void setCarPaint(String carPaint) { this.carPaint = carPaint; }

    public boolean isHasHood() { return hasHood; }
    public void setHasHood(boolean hasHood) { this.hasHood = hasHood; }

    public boolean isHasLatteArt() { return hasLatteArt; }
    public void setHasLatteArt(boolean hasLatteArt) { this.hasLatteArt = hasLatteArt; }

    public boolean isHasCarbonFiberRoof() { return hasCarbonFiberRoof; }
    public void setHasCarbonFiberRoof(boolean hasCarbonFiberRoof) { this.hasCarbonFiberRoof = hasCarbonFiberRoof; }

    public boolean isHasRearWing() { return hasRearWing; }
    public void setHasRearWing(boolean hasRearWing) { this.hasRearWing = hasRearWing; }

    public boolean isHasCarbonFiberMirror() { return hasCarbonFiberMirror; }
    public void setHasCarbonFiberMirror(boolean hasCarbonFiberMirror) { this.hasCarbonFiberMirror = hasCarbonFiberMirror; }
}

interface Builder {
    void buildCarPaint(String color);
    void buildCarHood();
    void buildLatteArt();
    void buildCarbonFiberRoof();
    void buildRearWing();
    void buildCarbonFiberMirror();
    Car getResult();
}

class Su7Builder implements Builder {
    private Car car;

    public Su7Builder() {
        this.car = new Car();
    }

    @Override
    public void buildCarPaint(String color) {
        car.setCarPaint(color);
    }

    @Override
    public void buildCarHood() {
        car.setHasHood(true);
    }

    @Override
    public void buildLatteArt() {
        car.setHasLatteArt(true);
    }

    @Override
    public void buildCarbonFiberRoof() {
        car.setHasCarbonFiberRoof(true);
    }

    @Override
    public void buildRearWing() {
        car.setHasRearWing(true);
    }

    @Override
    public void buildCarbonFiberMirror() {
        car.setHasCarbonFiberMirror(true);
    }

    @Override
    public Car getResult() {
        return car;
    }
}

class Su7proBuilder implements Builder {
    private Car car;

    public Su7proBuilder() {
        this.car = new Car();
    }

    @Override
    public void buildCarPaint(String color) {
        car.setCarPaint(color);
    }

    @Override
    public void buildCarHood() {
        car.setHasHood(true);
    }

    @Override
    public void buildLatteArt() {
        car.setHasLatteArt(true);
    }

    @Override
    public void buildCarbonFiberRoof() {
        car.setHasCarbonFiberRoof(true);
    }

    @Override
    public void buildRearWing() {
        car.setHasRearWing(true);
    }

    @Override
    public void buildCarbonFiberMirror() {
        car.setHasCarbonFiberMirror(true);
    }

    @Override
    public Car getResult() {
        return car;
    }
}

class Su7maxBuilder implements Builder {
    private Car car;

    public Su7maxBuilder() {
        this.car = new Car();
    }

    @Override
    public void buildCarPaint(String color) {
        car.setCarPaint(color);
    }

    @Override
    public void buildCarHood() {
        car.setHasHood(true);
    }

    @Override
    public void buildLatteArt() {
        car.setHasLatteArt(true);
    }

    @Override
    public void buildCarbonFiberRoof() {
        car.setHasCarbonFiberRoof(true);
    }

    @Override
    public void buildRearWing() {
        car.setHasRearWing(true);
    }

    @Override
    public void buildCarbonFiberMirror() {
        car.setHasCarbonFiberMirror(true);
    }

    @Override
    public Car getResult() {
        return car;
    }
}

class Su7ultraBuilder implements Builder {
    private Car car;

    public Su7ultraBuilder() {
        this.car = new Car();
    }

    @Override
    public void buildCarPaint(String color) {
        car.setCarPaint(color);
    }

    @Override
    public void buildCarHood() {
        car.setHasHood(true);
    }

    @Override
    public void buildLatteArt() {
        car.setHasLatteArt(true);
    }

    @Override
    public void buildCarbonFiberRoof() {
        car.setHasCarbonFiberRoof(true);
    }

    @Override
    public void buildRearWing() {
        car.setHasRearWing(true);
    }

    @Override
    public void buildCarbonFiberMirror() {
        car.setHasCarbonFiberMirror(true);
    }

    @Override
    public Car getResult() {
        return car;
    }
}

//指导者类
class Director {
    public Car makeCar(Builder builder) {
//        builder.buildCarPaint("Red"); // 示例颜色，可以根据需要修改
        builder.buildCarHood();
        builder.buildLatteArt();
        builder.buildCarbonFiberRoof();
        builder.buildRearWing();
        builder.buildCarbonFiberMirror();
        return builder.getResult();
    }
}

class Main {
    public static void main(String[] args) {
        Director director = new Director();
        Builder builder = new Su7maxBuilder();
        builder.buildCarPaint("Blue");

        Car car = director.makeCar(builder);

        System.out.println("Car Paint: " + car.getCarPaint());
        System.out.println("Has Hood: " + car.isHasHood());
        System.out.println("Has Latte Art: " + car.isHasLatteArt());
        System.out.println("Has Carbon Fiber Roof: " + car.isHasCarbonFiberRoof());
        System.out.println("Has Rear Wing: " + car.isHasRearWing());
        System.out.println("Has Carbon Fiber Mirror: " + car.isHasCarbonFiberMirror());
    }
}